﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ChoViet.CMS.ViewModels.SettingsEditModel>" %>
<%@ Import Namespace="ChoViet.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Quản lý thiết lập mặc định
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

  <%if (ViewData["MessageInfo"] == null)
      { %>
    <% using (Html.BeginForm("Edit", "SettingsDefault", FormMethod.Post, new { id = "adminForm" }))
       {%>
    <%= Html.ValidationSummary(true)%>
    <table class="admintable" width="100%">
        <tbody>
            <tr>
                <td class="key">
                    Tên key(<font color="red">*</font>):
                </td>
                <td>
                     <b><%=Model.SettingsDefault.Value %></b>
                </td>
            </tr>
            <tr>
                <td class="key">Giá trị (<font color="red">*</font>):</td>
                <td><%=Html.TextBoxFor(m => m.SettingsDefault.Text, new { @class="required", style="width:250px"})%>
                    <%=Html.HiddenFor(m => m.SettingsDefault.Value)%></td>
            </tr>
            <tr>
                <td class="key">Mô tả</td>
                <td>
                    <%=Html.TextAreaFor(m => m.SettingsDefault.Description, new { style = "width:650px ; height:100px" })%>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="submit" id="btnSave" value="Lưu thay đổi" name ="btnSave" />
                </td>
            </tr>            
        </tbody>
    </table>
    <%}
  } %>
  <script type ="text/javascript">
  	$(document).ready(function() {
  		$("#adminForm").validate({
  			rules: {
  			"Value": "required",
  			"Text": "required",
  			},
  			messages: {
  				"Value": "Thông tin bắt buộc phải nhập",
  				"Text": "Thông tin bắt buộc phải nhập"
  			}
  		});
  	});
  	tinyMCE.init({
            mode: "textareas",
            theme: "advanced",
            plugins: "paste,imagemanager",
            theme_advanced_buttons1: "pastetext,separator,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,insertimage",
            theme_advanced_buttons2: "",
            theme_advanced_buttons3: "",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_statusbar_location: "bottom",
            paste_use_dialog: false,
            paste_auto_cleanup_on_paste: true,
            paste_convert_headers_to_strong: false,
            paste_strip_class_attributes: "all",
            paste_remove_spans: true,
            paste_remove_styles: true
        });
  </script>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Toolbar" runat="server">
<%= Html.Toolbar("Quay về", "/SettingsDefault", "back")%>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Header" runat="server">
Sửa thiết lập mặc định
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Message" runat="server">
 <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>
</asp:Content>
